from likeshop.base.mybase import Tools


# 添加收货地址
class add_address_model(Tools):
    # 定义登录路径
    path = "/page/user_address/add"

    # 发送登录请求
    def add_address_action(self, addm, coin, sheng_id, shi_id, qv_id, xiang_xi, mo_ren, db):
        mydata = {
            'contact': addm,
            'telephone': coin,
            'province_id': sheng_id,
            'city_id': shi_id,
            'district_id': qv_id,
            'address': xiang_xi,
            'is_default': mo_ren
        }
        res = self.session.post(url=self.hosturl+self.path, data=mydata, headers=db)
        return res.json()
